try:
     while True:
          tempInput = input().split( )
          num = int(tempInput[0])
          sign = tempInput[1]
          maxlen=1
          cost=1
          remaining=0
          while num > cost:
               if num >= cost +2*(maxlen+2):
                    maxlen += 2
                    cost += 2*maxlen
               else:
                    remaining = num -cost
                    break
          for i in range(maxlen//2+1):
               print(" "*i,end="")
               print(sign*(maxlen-i*2),end="")
               print(" ")
          for i in range(maxlen//2-1,-1,-1):
               print(" "*i,end="")
               print(sign*(maxlen-i*2),end="")
               print(" "*i)
          print(remaining)
except Exception:
     pass